package com.quantdo.demo.date;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.ui.IEditorInput;

public class NavigatorElement implements IElement {

	private String name;
	private IEditorInput editorInput;
	private List<IElement> childrenEle;
	
	public NavigatorElement(String name) {
		super();
		this.name = name;
	}

	@Override
	public void setName(String name) {
		this.name = name;
	}

	@Override
	public String getName() {
		return this.name;
	}

	@Override
	public void setChilren(List<IElement> children) {
		this.childrenEle = children;
	}

	@Override
	public List<IElement> getChildren() {
		return this.childrenEle;
	}

	@Override
	public boolean hasChildren() {
		return null == this.childrenEle || this.childrenEle.isEmpty()?false:true;
	}

	@Override
	public void addChild(IElement children) {
		if(null == this.childrenEle){
			this.childrenEle = new ArrayList<>();
		}
		this.childrenEle.add(children);
	}

	public IEditorInput getEditorInput() {
		return editorInput;
	}

	public void setEditorInput(IEditorInput editorInput) {
		this.editorInput = editorInput;
	}

}
